package chabernac.android.wordbattle.paint.gameselection;

import chabernac.android.wordbattle.paint.AbstractBitmapDrawable;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint.Style;
import android.graphics.RectF;
import android.graphics.Shader;

public class SelectionDrawable extends AbstractBitmapDrawable {
  
  public SelectionDrawable(int aX, int aY, int aWidth, int aHeigth, int aTransparency) {
    super(aX, aY, aWidth, aHeigth, aTransparency);
  }

  protected void doPaint(Canvas aCanvas) {
//    thePaint.setAlpha(255);
    myPaint.setAntiAlias(true);
    myPaint.setColor(Color.parseColor("#6321FF"));
    myPaint.setShader(new LinearGradient(myX, myY, myX + myWidth, myY + myHeight, Color.parseColor("#330FFF"), Color.parseColor("#C62BFF"), Shader.TileMode.CLAMP));
    RectF theRect = new RectF();
    theRect.left = 6;
    theRect.top = 6;
    theRect.right = getWidth() - 6;
    theRect.bottom = getHeight() - 6;
    aCanvas.drawRoundRect(theRect, 40, 40, myPaint);
    
    myPaint.setStyle(Style.STROKE);
    myPaint.setColor(Color.parseColor("#0800FF"));
    myPaint.setStrokeWidth(6);
    myPaint.setShader(null);
    aCanvas.drawRoundRect(theRect, 40, 40, myPaint);
  }
}
